﻿@using DeliveryPlus.Web.Classes.Ext
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    @* Мета *@
    <meta name="viewport" content="width=968px" />
    <title>@ViewBag.Title | Доставка Плюс - заказ и доставка еды по Хабаровску</title>
    <meta name="keywords" content="доставка еды, доставка еды хабаровск, китайская кафе, японское кафе, суши, роллы, мясо, тануки, еда, заказ еды, @ViewBag.keywords"/>
    <meta name="description" content="Доставка плюс - доставка еды в Хабаровске, @ViewBag.description"/>
    @* Скрипты и стили *@
    <link href="~/Content/styles/stylesheets/all.css" rel="stylesheet" />
    <script src="~/Scripts/jquery-2.0.3.min.js"></script>
    <script src="~/Scripts/jquery.validate.min.js"></script>
    <script src="~/Scripts/moneyutils.js"></script>
    <script src="~/Scripts/lazy.js"></script>
    <script src="~/Scripts/css.js"></script>
</head>
<body>
    @* Заголовок страницы *@
    <header id="header">
        <div id="header-content">
            <a id="logo" href="/">
                <img src="/Content/images/layout/logo.png" alt="Доставка плюс" />
            </a>
            <div id="header-dish">
                <img src="/Content/images/layout/dish1.png" class="active" />
                <img src="/Content/images/layout/dish2.png" style="display: none" />
                <img src="/Content/images/layout/dish3.png" style="display: none" />
                <img src="/Content/images/layout/dish4.png" style="display: none" />
                <img src="/Content/images/layout/dish5.png" style="display: none" />
                <img src="/Content/images/layout/dish6.png" style="display: none" />
                <img src="/Content/images/layout/dish7.png" style="display: none" />
                <img src="/Content/images/layout/dish8.png" style="display: none" />
            </div>
            <div id="header-contacts">
                <img src="/Content/images/layout/phone-icon.png" id="phone-icon" />
                <img src="/Content/images/layout/phone.png" id="phone-number" alt="" />
                <div id="phone-desc">
                    Телефон горячей линии <span class="red">9:00 - 02:00</span>
                </div>
                <form action="/search" id="search-form" method="GET">
                    <input type="text" placeholder="поиск блюд" name="q" id="search-field" /><input type="submit" style="display: none" />
                </form>
            </div>
        </div>
    </header>
    @* Навигационное меню *@
    <div id="menu-wrapper-outer">
        <nav id="menu">
            <div id="menu-bg">
                <div id="menu-wrapper">
                    <div id="checkout">
                        <div id="current-order">
                            Чек: <span id="dishes-count">@HttpContext.Current.Request.GetOrderedDishesCount()</span> | <span id="total-sum">@HttpContext.Current.Request.GetOrderSum()</span>
                        </div>
                        <div id="checkout-button" onclick="window.location.href='/checkout'">
                        </div>
                    </div>
                    <ul id="menu-items">
                        <li id="main-menu-item">
                            <a href="/">
                                <div class="menu-item-image"></div>
                                <div class="menu-item-text">Главная</div>
                            </a>
                        </li>
                        <li id="cafe-menu-item">
                            <a href="/cafe">
                                <div class="menu-item-image"></div>
                                <div class="menu-item-text">Заведения</div>
                            </a>
                        </li>
                        <li id="dishes-menu-item">
                            <a href="/video">
                                <div class="menu-item-image"></div>
                                <div class="menu-item-text">Видео</div>
                            </a>
                        </li>
                        <li id="delivery-menu-item">
                            <a href="/delivery">
                                <div class="menu-item-image"></div>
                                <div class="menu-item-text">О доставке</div>
                            </a>
                        </li>
                        <li id="contacts-menu-item">
                            <a href="/contacts">
                                <div class="menu-item-image"></div>
                                <div class="menu-item-text">Контакты</div>
                            </a>
                        </li>
                    </ul>
                </div>
            </div>
        </nav>
    </div>
    <div class="homepage">
        <a onclick="setHome(this); return false" href="#">Сделать страницу стартовой</a>
    </div>
    <div id="layout-content">
        @RenderBody()
    </div>
    <footer id="footer">
        <div id="footer-bg">
            <a href="/" id="footer-logo">
                <img src="/Content/images/layout/logo.png" alt="Доставка плюс" />
            </a>
            <div id="footer-contacts">
                <img src="/Content/images/layout/phone.png" id="footer-phone-number" alt="" />
                <div id="footer-phone-desc">
                    Телефон горячей линии <span class="red">9:00 - 02:00</span>
                </div>
                <div id="social">
                    Мы в социальных сетях: 
                    <a href="http://vk.com/public65316459" id="social-vk" target="_blank"></a>
                    <a href="http://www.odnoklassniki.ru/group/51794448220289 " id="social-ok" target="_blank"></a>
                    <a href="https://www.facebook.com/dostavka.plus.3" id="social-fb" target="_blank"></a>
                    <a href="http://my.mail.ru/community/dostavkaplus/?ref=cat" id="social-mail" target="_blank"></a>
                    <a href="https://twitter.com/dostavkaplus2" id="social-tw" target="_blank"></a>
                </div>
            </div>
        </div>
        <div id="forged">
            <div id="forged-logo">
            </div>
        </div>
    </footer>
    <div id="scrollToTop"></div>
    <div id="overlay"></div>
    <div id="success-dlg"></div>
    <script>
        function setHome(ob) {
            ob.style.behavior = 'url(#default#homepage)';
            ob.setHomePage(document.location);
        }
    </script>
    <script type="text/javascript">
        // Добавляет блюдо в заказ
        function orderDish(dishId) {
            $.post("/add-dish", { id: dishId }, function (data) {
                if (data.success == true) {
                    $("#dishes-count").text(data.count);
                    $("#total-sum").text(data.sum);
                    showSuccess();
                    yaCounter23548060.reachGoal("add_dish");
                } else {
                    alert(data.msg);
                }
            }, "json");
        }

        function showSuccess() {
            $("#overlay").width(window.innerWidth).height(window.innerHeight).stop(true, true).fadeIn("slow");
            var left = window.innerWidth / 2 - 448 / 2;
            var top = window.innerHeight / 2 - 251 / 2;
            $("#success-dlg").css("left", left.toString() + "px").css("top", top.toString() + "px").stop(true, true).fadeIn("slow");
            setTimeout(function () {
                $("#overlay").stop(true, true).fadeOut("slow");
                $("#success-dlg").stop(true, true).fadeOut("slow");
            }, 1000);
        }

        // Смена блюд при наведении
        $("#header-dish").mouseenter(function () {
            var current = $("#header-dish .active").index();
            var next = 0;
            do {
                next = Math.floor(Math.random() * 7) + 1;
            } while (current == next)
            var imgs = $("#header-dish img");
            imgs.removeClass("active");
            imgs.eq(current).stop(true, true).fadeOut("slow");
            imgs.eq(next).stop(true, true).addClass("active").fadeIn("slow");
        });

        // Ленивая загрузка изображений
        if (!window.opera) {
            $("img.lazy").lazyload({
                effect: "fadeIn"
            });
        } else {
            $("img.lazy").each(function (index, item) {
                $(item).attr("src", $(item).data("original"));
            });
        }

        // Прокрутка до верху
        //Check to see if the window is top if not then display button
        $(window).scroll(function () {
            if ($(this).scrollTop() > 200) {
                $('#scrollToTop').fadeIn();
            } else {
                $('#scrollToTop').fadeOut();
            }
        });

        //Click event to scroll to top
        $('#scrollToTop').click(function () {
            $('html, body').animate({ scrollTop: 0 }, 0);
            return false;
        });
    </script>
    <!-- Yandex.Metrika counter -->
    <script type="text/javascript">
        (function (d, w, c) {
            (w[c] = w[c] || []).push(function () {
                try {
                    w.yaCounter23548060 = new Ya.Metrika({
                        id: 23548060,
                        webvisor: true,
                        clickmap: true,
                        trackLinks: true,
                        accurateTrackBounce: true
                    });
                } catch (e) { }
            });

            var n = d.getElementsByTagName("script")[0],
                s = d.createElement("script"),
                f = function () { n.parentNode.insertBefore(s, n); };
            s.type = "text/javascript";
            s.async = true;
            s.src = (d.location.protocol == "https:" ? "https:" : "http:") + "//mc.yandex.ru/metrika/watch.js";

            if (w.opera == "[object Opera]") {
                d.addEventListener("DOMContentLoaded", f, false);
            } else { f(); }
        })(document, window, "yandex_metrika_callbacks");
    </script>
    <noscript>
        <div>
            <img src="//mc.yandex.ru/watch/23548060" style="position: absolute; left: -9999px;" alt="" />
        </div>
    </noscript>
    <!-- /Yandex.Metrika counter -->
</body>
</html>
